package com.vivid.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.vivid.system.mapper.ModelMapper;
import com.vivid.system.domain.Model;
import com.vivid.system.service.IModelService;

/**
 * 模型表Service业务层处理
 *
 * @author vivid
 * @date 2022-08-09
 */
@Service
public class ModelServiceImpl implements IModelService
{
    @Autowired
    private ModelMapper modelMapper;

    /**
     * 查询模型表
     *
     * @param modelId 模型表主键
     * @return 模型表
     */
    @Override
    public Model selectModelByModelId(Long modelId)
    {
        return modelMapper.selectModelByModelId(modelId);
    }

    /**
     * 查询模型表列表
     *
     * @param model 模型表
     * @return 模型表
     */
    @Override
    public List<Model> selectModelList(Model model)
    {
        return modelMapper.selectModelList(model);
    }

    @Override
    public Model selectModelByModelName(String name) {
        return modelMapper.selectModelByModelName(name);
    }

    /**
     * 新增模型表
     *
     * @param model 模型表
     * @return 结果
     */
    @Override
    public int insertModel(Model model)
    {
        return modelMapper.insertModel(model);
    }

    /**
     * 修改模型表
     *
     * @param model 模型表
     * @return 结果
     */
    @Override
    public int updateModel(Model model)
    {
        return modelMapper.updateModel(model);
    }

    /**
     * 批量删除模型表
     *
     * @param modelIds 需要删除的模型表主键
     * @return 结果
     */
    @Override
    public int deleteModelByModelIds(Long[] modelIds)
    {
        return modelMapper.deleteModelByModelIds(modelIds);
    }

    /**
     * 删除模型表信息
     *
     * @param modelId 模型表主键
     * @return 结果
     */
    @Override
    public int deleteModelByModelId(Long modelId)
    {
        return modelMapper.deleteModelByModelId(modelId);
    }
}
